#include "fun.h"
#include "slist.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int my_print(void *data)
{
    node_t *tmp = NULL;

    // 参数检查
    if (NULL == data)
    {
        perror("argument lawless...");
        goto err0;
    }

    // 打印输出
    tmp = data;
    printf("%d ", *(int *)(tmp->data));

    return 0;
err0:
    return -1;
}

int my_destroy(void *data)
{
    node_t *tmp = NULL;

    // 参数检查
    if (NULL == data)
    {
        perror("argument lawless...");
        goto err0;
    }

    tmp = data;
    // 销毁节点
    free(tmp->data);
    tmp->data = NULL;
    free(tmp);
    tmp = NULL;


    return 0;
err0:
    return -1;
}

int my_compare(void *data)
{
    node_t *tmp = NULL;

    // 参数检查
    if (NULL == data)
    {
        perror("argument lawless...");
        goto err0;
    }

    tmp = data;

    


    return 0;
err0:
    return -1;
}